Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Managing Objects

QuickDraw 3D provides several routines that you can use to operate on any QuickDraw 3D object. The top level of the QuickDraw 3D class hierarchy ( TQ3Object ) supports dispose, duplicate, draw, and file I/O methods.

Q3Object_Submit

You can use the Q3Object_Submit function to submit a QuickDraw 3D object for drawing, picking, bounding, or writing.

TQ3Status Q3Object_Submit (TQ3Object object, TQ3ViewObject view);
object
A QuickDraw 3D object.
view
A view.

DESCRIPTION

The Q3Object_Submit function submits the QuickDraw 3D object specified by the object parameter for drawing, picking, bounding, or writing in the view specified by the view parameter.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

ERRORS

kQ3ErrorInvalidObjectParameter kQ3ErrorOutOfMemory kQ3ErrorBeginWriteNotCalled kQ3ErrorNoWriteMethods kQ3ErrorEndOfFile

Q3Object_Dispose

You can use the Q3Object_Dispose function to dispose of a QuickDraw 3D object.

TQ3Status Q3Object_Dispose (TQ3Object object);
object
A QuickDraw 3D object.

DESCRIPTION

The Q3Object_Dispose function disposes of the QuickDraw 3D object specified by the object parameter. If the specified object is not a shared object, QuickDraw 3D disposes of any memory occupied by that object. If the specified object is a shared object, QuickDraw 3D reduces by 1 the reference count associated with that object. When the reference count is reduced to 0, Q3Object_Dispose disposes of the memory occupied by the object.

In general, you need to call Q3Object_Dispose for any objects returned by a Get call (for example, Q3View_GetDrawContext ). Failure to call Q3Object_Dispose on such objects will result in a memory leak.

ERROR

kQ3ErrorInvalidObjectParameter

Q3Object_Duplicate

You can use the Q3Object_Duplicate function to duplicate a QuickDraw 3D object.

TQ3Object Q3Object_Duplicate (TQ3Object object);
object
A QuickDraw 3D object.

DESCRIPTION

The Q3Object_Duplicate function returns, as its function result, a QuickDraw 3D object that is an exact duplicate of the QuickDraw 3D object specified by the object parameter. If the new object is a shared object, its reference count is set to 1.

The Q3Object_Duplicate function cannot duplicate DrawContext or View objects. These object classes contain resources created by the application that belong to the window system. Because the QuickDraw 3D library cannot duplicate windows or colormaps, it cannot duplicate objects containing them.

ERRORS

kQ3ErrorInvalidObjectParameter kQ3ErrorOutOfMemory

Q3Object_IsDrawable

You can use the Q3Object_IsDrawable function to determine whether a QuickDraw 3D object is drawable.

TQ3Boolean Q3Object_IsDrawable (TQ3Object object);
object
A QuickDraw 3D object.

DESCRIPTION

The Q3Object_IsDrawable function returns, as its function result, a Boolean value that indicates whether the QuickDraw 3D object specified by the object parameter is drawable ( kQ3True ) or not ( kQ3False ).

ERROR

kQ3ErrorInvalidObjectParameter

Q3Object_IsWritable

You can use the Q3Object_IsWritable function to determine whether a QuickDraw 3D object is writable.

TQ3Boolean Q3Object_IsWritable (TQ3Object object);
object
A QuickDraw 3D object.

DESCRIPTION

The Q3Object_IsWritable function returns, as its function result, a Boolean value that indicates whether the QuickDraw 3D object specified by the object parameter can be written to a file object ( kQ3True ) or not ( kQ3False ).

ERROR

kQ3ErrorInvalidObjectParameter


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |